

#ifndef __UCTCUI_H__
#define __UCTCUI_H__

#include "zadui.h"
#include "zAdAChar.h"
#include <afxtempl.h>

#ifdef  _UCTCUI_BUILD
#  define   UCTCUI_PORT  __declspec(dllexport)
#else
#  define   UCTCUI_PORT  
#endif

class CUcTcUiManager;
class CUcTcUiToolPaletteSet;
class CUcTcUiToolPalette;
class CUcTcUiCatalogView;
class UcTcCatalogItem;
class UcTcCatalog;
class UcTcStockTool;
class UcTcTool;

typedef CTypedPtrArray<CPtrArray, UcTcCatalogItem*> UcTcCatalogItemArray;
typedef CTypedPtrArray<CPtrArray, UcTcStockTool*>   UcTcStockToolArray;
typedef CTypedPtrArray<CPtrArray, UcTcCatalog*>     UcTcCatalogArray;
typedef CTypedPtrArray<CPtrArray, CUcTcUiToolPaletteSet*> UcTcUiToolPaletteSetArray;
typedef CTypedPtrArray<CPtrArray, CUcTcUiToolPalette*> UcTcUiToolPaletteArray;
typedef CTypedPtrArray<CPtrArray, CUcTcUiCatalogView*> UcTcUiCatalogViewArray;

#define UCTCUI_DRAGFORMAT_CUSTOM        (0x1 << 0)
#define UCTCUI_DRAGFORMAT_IDROP         (0x1 << 1)
#define UCTCUI_DRAGFORMAT_HDROP         (0x1 << 2)

#define UCTCUI_CNPS_NOCREATEWINDOW      (0x1 << 0)
#define UCTCUI_CNPS_NOADD               (0x1 << 1)
#define UCTCUI_CNPS_CREATEHIDDEN        (0x1 << 2)

#define CF_UCTC_CATALOG_ITEM_17_11          UCRX_T("CF_UCTC_CATALOG_ITEM_17_11")
#define CF_UCTCUI_CATALOG_ITEM_HEADER_17_11 UCRX_T("CF_UCTCUI_CATALOG_ITEM_HEADER_17_11")
#define CF_UCTC_CATALOG_ITEM_17_1           UCRX_T("CF_UCTC_CATALOG_ITEM_17_1")
#define CF_UCTCUI_CATALOG_ITEM_HEADER_17_1  UCRX_T("CF_UCTCUI_CATALOG_ITEM_HEADER_17_1")
#define CF_UCTC_CATALOG_ITEM_16_1           UCRX_T("CF_UCTC_CATALOG_ITEM_16_1")
#define CF_UCTCUI_CATALOG_ITEM_HEADER_16_1  UCRX_T("CF_UCTCUI_CATALOG_ITEM_HEADER_16_1")
#define CF_UCTCUI_CATALOG_ITEM              UCRX_T("CF_UCTC_CATALOG_ITEM")
#define CF_UCTCUI_CATALOG_ITEM_HEADER       UCRX_T("CF_UCTCUI_CATALOG_ITEM_HEADER")
#define CF_IDROP_UCTCUI_TOOL                UCRX_T("CF_IDROP.XML_UCTCUI_TOOL")
#define CF_IDROP_UCTCUI_PALETTE             UCRX_T("CF_IDROP.XML_UCTCUI_PALETTE")
#define CF_IDROP_UCTCUI_PACKAGE             UCRX_T("CF_IDROP.XML_UCTCUI_PACKAGE")
#define CF_IDROP_UCTCUI_CATEGORY            UCRX_T("CF_IDROP.XML_UCTCUI_CATEGORY")
#define CF_IDROP_UCTCUI_CATALOG             UCRX_T("CF_IDROP.XML_UCTCUI_CATALOG")
#define CF_IDROP_UCTCUI_STOCKTOOL           UCRX_T("CF_IDROP.XML_UCTCUI_STOCKTOOL")
#define CF_UCTCUI_TOOLBAR_ITEM              UCRX_T("CF_UCTCUI_TOOLBAR_ITEM")

#define UCTCUI_PI_SHOW_PROGRESS         (0x1 << 0)
#define UCTCUI_PI_USE_NEW_IDS           (0x1 << 1)
#define UCTCUI_PI_BREAK_SOURCE_LINK     (0x1 << 2)      
#define UCTCUI_PI_NOTIFY_TOOLS          (0x1 << 3)      

typedef struct UCTCUI_DRAG_HEADER
{
    DWORD               mdwDragFormat;
#ifdef _ZSOFT_WINDOWS_
	CLIPFORMAT          mcfClipFormat;   
#endif   
    BOOL                mbUECADSource;
    DWORD               mdwSourceProcessId; 
    GUID                mRootId;            
    GUID                mParentId;          
    BOOL                mbReadOnlySource;   
    int                 mnCount;            
    int                 mnStockTools;       
    DWORD               mdwItemTypes;       
} UCTCUI_DRAG_HEADER;

UCTCUI_PORT CUcTcUiManager* UcTcUiGetManager(void);
#ifdef _ZSOFT_WINDOWS_
UCTCUI_PORT BOOL        UcTcUiCopyItems     (COleDataSource* pDataSource,
                                             const UcTcCatalogItemArray* pItems,
                                             BOOL bUECADSource);
UCTCUI_PORT BOOL        UcTcUiGetDragInfo   (IDataObject* pDataObject,
                                             UCTCUI_DRAG_HEADER* pHeader);
UCTCUI_PORT BOOL        UcTcUiPasteItems    (IDataObject* pDataObject,
                                             UcTcCatalogItemArray* pItems,
                                             UcTcCatalogItemArray* pStockTools,
                                             DWORD dwFlag = UCTCUI_PI_SHOW_PROGRESS);
UCTCUI_PORT CUcTcUiToolPaletteSet* UcTcUiGetToolPaletteWindow(void);
UCTCUI_PORT BOOL        UcTcUiFilterShapesDialog(UcTcCatalogItem* pPackage,
                                             UcTcCatalogItemArray* pActiveShapes,
                                             UcTcTool*& pCurrentShape,
                                             CWnd* pParentWnd);
#endif

#endif 
